/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 IServerInstancesRegistry.hpp. Created on: 09.06.2009 16:07:17
 */

#ifndef ISERVERINSTANCESREGISTRY_HPP_
#define ISERVERINSTANCESREGISTRY_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "IServerInstancesRegistryListener.hpp"

namespace smartobjects {

class IServerInstancesRegistry : public virtual RefObject {
public:
	SO_DLLPRFX virtual ~IServerInstancesRegistry();

	virtual void addInstance ( class IServerSkeleton* poInstance ) = 0;
	virtual void attachInstanceClientHandler ( class ConnectionHandler* poHandler, class IServerSkeleton* poInstance ) = 0;
	virtual void detachInstanceClientHandler ( class ConnectionHandler* poHandler, class IServerSkeleton* poInstance ) = 0;
	virtual void removeInstance ( class IServerSkeleton* poInstance ) = 0;

	virtual void addListener ( IServerInstancesRegistryListener* poListener ) = 0;
	virtual void delListener ( IServerInstancesRegistryListener* poListener ) = 0;


	virtual int getInstancesCount() = 0;

	virtual void setTimerWakeUpInterval ( unsigned long nIntervalInSec ) = 0;
	virtual unsigned long getTimerWakeUpInterval () = 0;
};

}

#endif /* ISERVERINSTANCESREGISTRY_HPP_ */
